package com.zml.pdf.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Insert;

import com.zml.pdf.entity.Pdfs;
@Mapper
public interface PdfMapper {
       @Select("select * from pdflist")
       public List<Pdfs> getPdf();

       @Select("select * from pdflist where id = #{id}")
       public Pdfs getPdfById(String id);

       @Select("select * from pdflist where name = #{name}")
       public Pdfs getPdfByName(String name);
       
       @Select("select * from jsonaeskey limit 1")
       public String getAESkey();
       
       @Insert({"insert into pdflist(time, id, name, path, pdfUrl, jsonUrl, openKey, totalPageNum)values(#{time},#{id},#{name},#{path},#{pdfUrl},#{jsonUrl},#{openKey},#{totalPageNum})"})
       public void insertPdf(Pdfs pdfs);

       @Insert({"delete from pdflist where id = #{id}"})
       public void deletePdf(String  id);
}
